package com.google.gwt.sample.stockwatcher.client.view;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class CustomDialogBox extends DialogBox {

	public CustomDialogBox(HTML txtHtml) {

		// Set the dialog box's caption.
		setText("Titulo del Dialog");

		// Enable animation.
		setAnimationEnabled(true);

		// Enable glass background.
		setGlassEnabled(true);

		// Aqui cuerpo del mensaje
		Button ok = new Button("Aceptar");
		// We can set the id of a widget by accessing its Element

		VerticalPanel dialogVPanel = new VerticalPanel();
		dialogVPanel.add(txtHtml);
		dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
		dialogVPanel.add(ok);
		setWidget(dialogVPanel);
		// DialogBox is a SimplePanel, so you have to set its widget property to
		// whatever you want its contents to be.


		ok.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				CustomDialogBox.this.hide();
			}
		});
	}
}
